<?php

namespace app\api\controller;


class News extends Common
{
	public function url(){
		echo date("Ymd");die;
	}
	
	public function test(){
//		$ch = curl_init();
//	    $url="http://image.baidu.com/";
//	    curl_setopt ( $ch , CURLOPT_USERAGENT ,"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.113 Safari/537.36" );
//	    curl_setopt($ch,CURLOPT_URL,$url);
//	    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//	    $content=curl_exec($ch);
//	    $string=file_get_contents($url); 
//	    preg_match_all("/<img([^>]*)\s*src=('|\")([^'\"]+)('|\")/", 
//	                    $string,$matches);
//	    $new_arr=array_unique($matches[3]);
//		$this->returnMsg(200, '获取数据！', $new_arr);
		$this->returnMsg(200, '获取数据！', $this->url());
	}
	
	
	/**
	 * 获取人民日报信息
	 */
    public function list(){
    	$result = $this->curl_file_get_contents('http://106.12.196.21:8080/peopleNew/list/1');
         $this->returnMsg(200, '获取数据！', $result);
    }
}
?>